//输入班级人员的C语言成绩，求及格人数，以及平均成绩

#include <stdio.h>
int main(){
	float grade[50] = {0};
	int count[2] = {0,0};
	float sum = 0;
	float avg = 0;
	int i = 0;
	while(grade[i] >= 0 && grade[i] <= 100){
		printf("输入C语言的成绩：");
		scanf("%f",&grade[i]);
		if(grade[i] >= 0 && grade[i] <= 100){
			sum = sum + grade[i];
			count[0]++;
			if(grade[i] >= 60 && grade[i] <= 100){
				count[1]++;
			} else{
				continue;
			}
		} else {
				continue;
		}  
		i++;
	}
	avg = sum / count[0];
	printf("及格人数为%d人\n",count[1]);
	printf("平均成绩为%.2f\n",avg);

	return 0;
}
